package com.xiaofeng.pochi.mapper;

import com.xiaofeng.pochi.pojo.ShopProductHistory;
import com.xiaofeng.pochi.pojo.ShopProductStatistic;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created with IntelliJ IDEA
 *
 * @Author: chc
 * @Date: 2022/08/27/22:05
 * @Description:
 */
@Component
public interface ShopProductStatisticMapper {

    /**
     * 根据商品编号查询浏览信息
     * @param id
     * @return
     */
    ShopProductStatistic getByProductId(Long id);


    /**
     * 保存浏览记录
     * */
    void saveByProductId(Long id);


    /**
     * 更新浏览数
     * @param id
     */
    void updateHistory(Long id);

    /**
     * 减少收藏数
     * @param productId
     */
    void removeCollectionCount(Long productId);

    /**
     * 增加收藏数
     * @param productId
     */
    void addCollectionCount(Long productId);

    List<ShopProductStatistic> getByProductIds(List<Long> productIds);
}
